---------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/kljusko/Dropbox/Papers/Measurement/Data Analysis/20170308_forJuskoWeissha
> arReplication/20170719_forJuskoWeisshaarReplication.log
  log type:  text
 opened on:  19 Jul 2017, 15:55:36

. 
. 
. #delimit;
delimiter now ;
. set scheme s1mono;

. *>>> B  DATA PREP;
. use ipums_cps_00012.dta, clear;

. set output error;
. *>>> D  TABLES AND FIGURES;
. *>> FIGURE 1: Composition of support;
. do 20170511_Composition.do;
. #delimit;
delimiter now ;
. use 20161021_Working_hh_1014.dta, clear;
. keep if year>=2011 & year<=2015;
. drop if FIPS==11;
. egen GROUP=rank(Y), unique;
. replace GROUP=round(GROUP/(_N/100));
. sort GROUP;
.                            collapse year Y totalTransfers hh_incwel hh_SNAP hh_incgovwk hh_
> incunemp hh_eitc hh_ctc hh_inceng 
>         socialInsurance credit transfers CPIU2016, by(GROUP);
. gen assistance_bar = ((socialInsurance + credit + transfers)/1000)*CPIU2016 ;
. label var assistance_bar "Social Assistance";
. gen eitc_bar = ((socialInsurance + credit)/1000)*CPIU2016;
. label var eitc_bar "EITC & CTC";
. gen insurance_bar= (socialInsurance/1000)*CPIU2016;
. label var insurance_bar "Social Insurance";
. *replace Y=(Y/1000)*CPIU2016;
. set scheme s1mono;
.         graph drop _all;
.                         twoway bar assistance_bar Y if Y<=50, barwidth(1) color("gs12")
>                                 || bar eitc_bar Y if Y<=50, barwidth(1) color("gs8")
>                                 || bar insurance_bar Y if Y<=50, barwidth(1) color("gs2")
>                                 legend(size(vsmall) region(lc(gs16))) 
>                                 xtitle("Market Income ($1000s)", size(medium)) 
>                                 ytitle("Social Transfers ($1000s)", size(medium))
>                                 legend( col(1) ring(0) pos(2) size(small))
>                                 xlabel(0(10)50)
>                                         ylabel(0(2)8);
.                                         graph save "20161021_Fig1_1014_US_bar.gph", replace
> ;
. graph export "20161021_Fig1_1014_US_bar.pdf", replace fontface("Helvetica");
. . *>> FIGURE 2: CA, FL, TX;
. do 20170511_CA_FL_TX.do;
. #delimit;
delimiter now ;
. use 20161021_Working_hh_1014.dta, clear;
.  keep if FIPS==6 | FIPS==12 | FIPS==48;
. by FIPS,sort: egen group=rank(Y), unique;
. by FIPS, sort: egen count=count(Y);
. replace count=count/100;
. replace group=round(group/count);
. collapse totalTransfer Y count (p25) p25TT=total (p75)p75TT=total, by(FIPS group);
.  twoway scatter total Y if FIPS==6 & Y<=50, m(Oh) msize(small) 
>         || rspike p75TT p25TT Y if FIPS==6 & Y<=50
>     || function 19.790-x, lcolor(gs2) lpattern(dash) range(0 19.790)
>         || function y=1.106+6.684*exp(-.0274*x) , range(0 50) lcolor("gs2")  lwidth(thick)
>         legend(off)
>         ylabel(0(5)20)
>         xlabel(0(10)50)
>         ytitle("Social Transfers")
>         xtitle("Market Income")
>         text(20 38 "California", size(large));
. ;
. graph save 20161021_CA.gph, replace;
. twoway scatter total Y if FIPS==12 & Y<=50, m(Oh) msize(small) 
>         || rspike p75TT p25TT Y if FIPS==12 & Y<=50
>         || function 19.790-x, lcolor(gs2) lpattern(dash) range(0 19.790)
>         || function y=.574+4.764*exp(-.0271*x) , range(0 50)
>         lcolor("gs2")  lwidth(thick)
>         legend(off)
>         ylabel(0(5)20)
>         xlabel(0(10)50)
>         ytitle("Social Transfers")
>         xtitle("Market Income")
>         text(20 42 "Florida", size(large));
. ;
. graph save 20161021_FL.gph, replace;
. twoway scatter total Y if FIPS==48 & Y<=50, m(Oh) msize(small)
>         || rspike p75TT p25TT Y if FIPS==48 & Y<=50
>         || function 19.790-x, lcolor(gs2) lpattern(dash) range(0 19.790)
>         || function y=.545+4.873*exp(-.02040*x) , range(0 50)  lwidth(thick)
>         lcolor("gs2")
>         legend(off)
>         ylabel(0(5)20)
>         xlabel(0(10)50)
>         ytitle("Social Transfers")
>         xtitle("Market Income")
>         text(20 42 "Texas", size(large));
. graph save 20161021_TX.gph, replace;
. graph combine 20161021_CA.gph 20161021_FL.gph 20161021_TX.gph, row(1);
. graph export "20161021_CA_FL_TX.pdf", replace fontface("Helvetica");
. . *>> FIGURE 3: Baseline Relief and Falloff;
. do 20170511_Plot_Parameters.do;
. #delimit;
delimiter now ;
. use "20161021_State_Parameters_w_Var.dta", clear;
. drop if FIPS==.;
. gen baseline=(A+B1);
. gen falloff=(B1 - B1*exp(B2));
. gen SE_baseline=V_A+V_B1+2*C_AB1;
. replace SE_baseline=(sqrt(SE_baseline));
. gen HI_baseline=baseline+1.96*SE_baseline;
. gen LO_baseline=baseline-1.96*SE_baseline;
. gen dfB1=(1- exp(B2));
. gen dfdB2=-B1*exp(B2);
. gen SE_falloff= V_B1 * dfB1^2  + V_B2* dfdB2^2   + 2*dfB1*dfdB2*C_B1B2 ;
. replace SE_falloff=sqrt(SE_falloff);
. gen HI_falloff=falloff+1.96*SE_falloff;
. gen LO_falloff=falloff-1.96*SE_falloff;
. set scheme s1mono;
. twoway rspike HI_baseline LO_baseline falloff, lc(gs10) lwidth(vthin)
>         || scatter baseline falloff, mlab(state_alpha)  m(0) mc(white) mlabp(0) mlabc("gs8"
> ) msize(med) mlabsize(small)
>         || rspike HI_baseline LO_baseline falloff if FIPS==6 | FIPS==48, lc(gs10) lwidth(vt
> hin)
>         || scatter baseline falloff if FIPS==6  | FIPS==12 | FIPS==48, ml(state_alpha) mlab
> c(gs2)   m(0) mc(white) mlabsize(small)
>                 m(i) mlabp(0)  msize(large)
>                 xline( .1115091, lc("gs10") lwidth(vthin)) 
>                 yline( 5.509253 , lc("gs10") lwidth(vthin)) 
>                 ylabel(3 "$3,000" 4 "$4,000" 5 "$5,000" 6 "$6,000" 7 "$7,000" 8 "$8,000", 
>                 labsize(vsmall)  format(%12.0fc))
>                 xlabel(.050 "$50" .075 "$75" .1 "$100" .125 "$125" .150 "$150" .175 "$175" 
> .2 "$200" 
>                 .225 "$225", labsize(vsmall) format(%12.0fc)) 
>                 legend(off) graphregion(color(white))   
>                 xtitle("Relief Falloff [B1*(1-exp(B2)]", size(small))   ytitle("Baseline Su
> pport [A+B1]", size(small))
>                 ;
(note:  named style 0 not found in class symbol, default attributes used)
(note:  named style med not found in class symbolsize, default attributes used)
.   graph save 20161021_Parameters.gph, replace;
. graph export 20161021_Parameter.pdf, replace fontface("Helvetica");
. . *>> FIGURE 4: Map of R, by State;
. do 20170511_Map.do;
. #delimit;
delimiter now ;
. clear;
. shp2dta using US_state_2012.shp, database(20161011_StateMap) coordinates(20161011_StateMap_
> coord) genid(id) replace;
. use 20161011_StateMap.dta, clear;
. destring STATEFP, gen(FIPS);
. save 20161011_StateMap_data.dta, replace;
. use 20161021_State_Parameters_w_Var.dta, clear;
.  merge 1:1 FIPS using 20161011_StateMap_data.dta;
. drop if _merge~=3;
. replace R_2=round(R_2*100);
. format R_2 %4.0f;
. spmap R_2 using 20161011_StateMap_coord if id!=1 & id!=45, id(id) 
>   fcolor(gs16 gs12 gs8 gs4) 
>   osize(vvthin vvthin vvthin vvthin)
>   legend(title("Poverty Relief Ratio (R)", size(vsmall)));
. graph save 20161021_Map.gph, replace;
. graph export 20161021_Map.pdf, replace fontface("Helvetica");
. . *>> TABLE 2: Poverty relief and policy (2010-2014), FIGURE 5: Poverty relief and policy;
. set output proc;

. do 20170511_TANF_UI.do;

. #delimit;
delimiter now ;
. clear;

. *>>> TANF;
. save 20161011_TANF_1014.dta, replace emptyok;
(note: dataset contains 0 observations)
file 20161011_TANF_1014.dta saved

. forvalues i=2010/2014{;
  2.  import excel using 20161011_WRD_TANF_Clean.xlsx, sheet(`i') cellra(A1:B52) firstrow cle
> ar;
  3. gen year=`i';
  4. append using 20161011_TANF_1014.dta;
  5. sort State;
  6. save 20161011_TANF_1014.dta, replace;
  7. };
file 20161011_TANF_1014.dta saved
file 20161011_TANF_1014.dta saved
(note: variable MAX_TANF was int, now double to accommodate using data's values)
file 20161011_TANF_1014.dta saved
(note: variable MAX_TANF was int, now double to accommodate using data's values)
file 20161011_TANF_1014.dta saved
(note: variable MAX_TANF was int, now double to accommodate using data's values)
file 20161011_TANF_1014.dta saved

. collapse MAX_TANF, by(State);

. merge 1:1 State using "FIPS.dta", nogen;

    Result                           # of obs.
    -----------------------------------------
    not matched                             1
        from master                         1  
        from using                          0  

    matched                                50  
    -----------------------------------------

. drop if FIPS==.;
(1 observation deleted)

. save 20161011_TANF_1014.dta, replace;
file 20161011_TANF_1014.dta saved

. *>>> UI;
. insheet using 20161011_awb_st_cy.csv, clear names;
(3 vars, 607521 obs)

. rename st state_alpha;

. gen year=substr(rptdate,8,4);
(303 missing values generated)

. destring year, replace;
year has all characters numeric; replaced as int
(303 missing values generated)

. keep if year>=2010 & year<=2014;
(538621 observations deleted)

. rename average AWBA;

. destring AWBA, replace;
AWBA has all characters numeric; replaced as double

. collapse AWBA, by(state);

. merge 1:1 state_alpha using "FIPS.dta", nogen;

    Result                           # of obs.
    -----------------------------------------
    not matched                             3
        from master                         3  
        from using                          0  

    matched                                50  
    -----------------------------------------

. drop if FIPS==.;
(3 observations deleted)

. save 20161012_AWBA_1014.dta, replace;
file 20161012_AWBA_1014.dta saved

. use "20161021_State_Parameters_w_Var.dta", clear;

. merge 1:1 FIPS using 20161012_AWBA_1014.dta, nogen;
(note: variable state_alpha was str2, now str9 to accommodate using data's values)

    Result                           # of obs.
    -----------------------------------------
    not matched                             0
    matched                                50  
    -----------------------------------------

. merge 1:1 FIPS using 20161011_TANF_1014.dta, nogen;

    Result                           # of obs.
    -----------------------------------------
    not matched                             0
    matched                                50  
    -----------------------------------------

. save 20161021_State_Parameters_w_Var_Policy.dta, replace;
file 20161021_State_Parameters_w_Var_Policy.dta saved

. drop if FIPS==2 | FIPS==15;
(2 observations deleted)

. replace R_2=R_2*100;
(48 real changes made)

. replace AWBA=AWBA*4;
(48 real changes made)

. regress R_2 AWBA;

      Source |       SS       df       MS              Number of obs =      48
-------------+------------------------------           F(  1,    46) =   10.73
       Model |  326.851553     1  326.851553           Prob > F      =  0.0020
    Residual |  1401.46281    46  30.4665828           R-squared     =  0.1891
-------------+------------------------------           Adj R-squared =  0.1715
       Total |  1728.31436    47   36.772646           Root MSE      =  5.5197

------------------------------------------------------------------------------
         R_2 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        AWBA |   .0131975   .0040293     3.28   0.002     .0050869     .021308
       _cons |   26.54389   4.837543     5.49   0.000     16.80643    36.28136
------------------------------------------------------------------------------

. regress R_2 MAX_TANF;

      Source |       SS       df       MS              Number of obs =      48
-------------+------------------------------           F(  1,    46) =    5.51
       Model |  184.980778     1  184.980778           Prob > F      =  0.0232
    Residual |  1543.33358    46  33.5507301           R-squared     =  0.1070
-------------+------------------------------           Adj R-squared =  0.0876
       Total |  1728.31436    47   36.772646           Root MSE      =  5.7923

------------------------------------------------------------------------------
         R_2 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    MAX_TANF |   .0133682   .0056932     2.35   0.023     .0019083     .024828
       _cons |   36.57218   2.527309    14.47   0.000     31.48497    41.65939
------------------------------------------------------------------------------

. twoway scatter R_2 AWBA, ml(state) mlabc("gs10") m(i) mlabp(0)
>   xline(1165.356, lc("gs10")) yline(41.57796 , lc("gs10")) 
>  xlabel(750(100)1650, labsize(medium) tlc(gs14) format(%3.0f))
>  ylabel(30(5)60, labsize(medium) glcolor("gs14") tlc(gs14)) 
>  xscale(lc(gs14)) yscale(lc(gs14))
>  legend(off) graphregion(color(white))   
>  xtitle("Average Monthly UI Benefit Amount")   ytitle("Poverty Relief (R)")
>  || lfit R_2 AWBA, lc(gs2) ;

. graph save "20161021_R_UI.gph", replace;
(file 20161021_R_UI.gph saved)

.  twoway scatter R_2 MAX, ml(state) mlabc("gs10") m(i) mlabp(0)
>   xline(425, lc("gs10")) yline(41.57796 , lc("gs10")) 
>  xlabel(150(50)750, labsize(medium) tlc(gs14) format(%3.0f))
>  ylabel(30(5)60, labsize(medium) glcolor("gs14") tlc(gs14)) 
>  xscale(lc(gs14)) yscale(lc(gs14))
>  legend(off) graphregion(color(white))   
>  xtitle("Maximum Monthly TANF Benefit")   ytitle("Poverty Relief (R)")
>  || lfit R_2 MAX, lc(gs2) ;

. graph save "20161021_R_TANF.gph", replace;
(file 20161021_R_TANF.gph saved)

.  set scheme s1mono;

. graph combine "20161021_R_UI.gph" "20161021_R_TANF.gph", rows(1) ;

. graph display, xsize(12) ysize(6);

. graph export "20161021_R_UI_TANF.pdf", fontface(Helvetica) replace;
(file /Users/kljusko/Dropbox/Papers/Measurement/Data Analysis/20170308_forJuskoWeisshaarRepli
> cation/20161021_R_UI_TANF.pdf written in PDF format)

. 
end of do-file

. *>> FIGURE 6:  National Time Series;
. do 20170511_US_times_series_Figure.do;

. #delimit;
delimiter now ;
. use 20161021_Annual_Parameters_w_Var_8814.dta, clear;

. replace year=year-1;
(29 real changes made)

. keep if year>1990;
(4 observations deleted)

. replace R_2=round(R_2*100);
(24 real changes made)

. format R_2 %3.0f;

. gen baseline=(A+B1);
(1 missing value generated)

. gen falloff=B1 - B1*exp(B2);
(1 missing value generated)

. twoway connected R_2 year, color("gs2") mlabel(R_2) mlabposition(12) mlabsize(vsmall)
>         xtitle("")
>         ylabel(30(10)75,  labsize(small) glcolor("gs14") tlc(gs14) format(%3.0f))
>         xlabel(1990(2)2014, noticks labsize(small))
>         ytitle("Poverty Relief", size(medsmall))
>           graphregion(color("white"))   xscale(lc(gs14)) yscale(lc(gs14))
>         xline(1990, lc("gs15")) xline(1993, lc("gs15")) xline(1997, lc("gs15")) xline(2001,
>  lc("gs15")) xline(2003, lc("gs15")) xline(2009, lc("gs15"))
>         text(72 1993 "OBRA-93", size(vsmall)) text(72 1997 "PRWOA", size(vsmall)) 
>         text(72 2000.5 "EGTRRA", size(vsmall)) text(72 2003.5 "JGTRRA", size(vsmall)) text(
> 72 2009 "ARRA", size(vsmall))
>    ;

.         graph save "20161021_R_US_88_12_paper.gph", replace;
(file 20161021_R_US_88_12_paper.gph saved)

. twoway connected baseline year, color("gs2") mlabsize(vsmall)
> xtitle("")
> ylabel(4 "$4,000" 6"$6,000" 8"$8,000" 10 "$10,000",  labsize(small) glcolor("gs14") tlc(gs1
> 4) format(%3.0f))
> xlabel(1990(2)2014, noticks labsize(small))
> ytitle("Baseline Relief", size(medsmall))
>           graphregion(color("white"))   xscale(lc(gs14)) yscale(lc(gs14))
> /*|| rspike HI_a_b1 LO_a_b1 year*/
>         ;

. graph save "20161021_a_b1_US_88_12_paper.gph", replace;
(file 20161021_a_b1_US_88_12_paper.gph saved)

. twoway connected falloff year, color("gs2") 
> xtitle("")
> ylabel(0"$0" .25 "$250" .5"$500" .75 "$750" 1"$1,000",  labsize(small) glcolor("gs14") tlc(
> gs14) format(%3.1f))
> xlabel(1990(2)2014,labsize(small) tlc(gs14))
> ytitle("Relief Falloff", size(medsmall))
>           graphregion(color("white"))   xscale(lc(gs14)) yscale(lc(gs14))
> ;

. graph save "20161021_B2_US_88_12_paper.gph", replace;
(file 20161021_B2_US_88_12_paper.gph saved)

.                 graph combine "20161021_R_US_88_12_paper.gph" "20161021_a_b1_US_88_12_paper
> .gph" 
> "20161021_B2_US_88_12_paper.gph", rows(3) graphregion(color("white"))  ;

. graph display, xsize(10) ysize(12);

. graph save "20161012_Combined_R_a_b1_B2_paper.gph",  replace;
(file 20161012_Combined_R_a_b1_B2_paper.gph saved)

.         graph export "20161012_Combined_R_a_b1_B2_paper.pdf",  replace fontface(Helvetica);
(file /Users/kljusko/Dropbox/Papers/Measurement/Data Analysis/20170308_forJuskoWeisshaarRepli
> cation/20161012_Combined_R_a_b1_B2_paper.pdf written in PDF format)

. 
end of do-file

. *>> FIGURE 7:  Varying Thresholds;
.   *>>> TABLE 3: Regression Analysis Using Different Poverty Thresholds;
. do 20170511_varyingThresholds.do;

. #delimit;
delimiter now ;
. use 20161021_Working_hh_1014.dta, clear;

. drop if FIPS==11;
(0 observations deleted)

. gen PSI_1=.5*19.790;

. gen PSI_2=1*19.790;

. gen PSI_3=1.5*19.790;

. gen PSI_4=2*19.790;

. gen GROSS=Y+totalT;

. forvalues p=1/4{;
  2.     gen POOR_`p'=1 if Y<=PSI_`p';
  3.   replace POOR_`p'=0 if Y>PSI_`p' & Y~=.;
  4.   gen POST_`p'=1 if GROSS<=PSI_`p';
  5.   replace POST_`p'=0 if GROSS>PSI_`p' & GROSS~=.;
  6.                   };
(225287 missing values generated)
(225287 real changes made)
(230149 missing values generated)
(230149 real changes made)
(208952 missing values generated)
(208952 real changes made)
(215829 missing values generated)
(215829 real changes made)
(189458 missing values generated)
(189458 real changes made)
(196923 missing values generated)
(196923 real changes made)
(168399 missing values generated)
(168399 real changes made)
(174074 missing values generated)
(174074 real changes made)

.   sort state;

.   collapse  POOR_* POST_* PSI_*, by(FIPS);

. save 20161021_PROP.dta, replace;
file 20161021_PROP.dta saved

. use 20161021_Working_hh_1014.dta, clear;

. keep if year>=2010;
(0 observations deleted)

. drop if FIPS==11;
(0 observations deleted)

. gen PSI_1=.5*19.790;

. gen PSI_2=1*19.790;

. gen PSI_3=1.5*19.790;

. gen PSI_4=2*19.790;

. gen GROSS=Y+totalT;

. forvalues p=1/4{;
  2.       gen POOR_`p'=1 if Y<=PSI_`p';
  3.     replace POOR_`p'=0 if Y>PSI_`p' & Y~=.;
  4.                 gen GAP_`p'=(PSI_`p'-Y)/PSI_`p';
  5.         replace GAP_`p'=0 if GAP_`p'<0;
  6.         gen POST_GAP_`p'=(PSI_`p'-GROSS)/PSI_`p';
  7.         replace POST_GAP_`p'=0 if POST_GAP_`p'<0;
  8.    };
(225287 missing values generated)
(225287 real changes made)
(225287 real changes made)
(230149 real changes made)
(208952 missing values generated)
(208952 real changes made)
(208952 real changes made)
(215829 real changes made)
(189458 missing values generated)
(189458 real changes made)
(189458 real changes made)
(196923 real changes made)
(168399 missing values generated)
(168399 real changes made)
(168399 real changes made)
(174074 real changes made)

. sort state;

.   collapse  POOR_* GAP* POST* PSI_*, by(FIPS);

. save 20161021_GAP.dta, replace;
file 20161021_GAP.dta saved

.   use   20161021_PROP.dta, clear;

. merge 1:1 FIPS using 20161021_GAP.dta, nogen;
(label STATEFIP already defined)

    Result                           # of obs.
    -----------------------------------------
    not matched                             0
    matched                                50  
    -----------------------------------------

. merge 1:1 FIPS using 20161021_State_Parameters_w_Var_Policy.dta, nogen;

    Result                           # of obs.
    -----------------------------------------
    not matched                             0
    matched                                50  
    -----------------------------------------

. forvalues p=1/4{;
  2.         gen PROP_RED_`p'=(POOR_`p'-POST_`p')/POOR_`p';
  3.         gen GAP_RED_`p'=(GAP_`p'-POST_GAP_`p')/GAP_`p';
  4.         egen RANK_PROP_`p'=rank(PROP_RED_`p'), field;
  5.         egen RANK_GAP_`p'=rank(GAP_RED_`p'), field;
  6.         egen RANK_R_`p'=rank(R_`p'), field;
  7.         };

.         twoway scatter GAP_RED_1 GAP_RED_2, mlab(state) m(i) mlabc(gs12) mlabsize(small)
>           || scatter GAP_RED_3 GAP_RED_2,  mlab(state) m(i) mlabc(gs8) mlabsize(small)
>           || scatter GAP_RED_4 GAP_RED_2,  mlab(state) m(i) mlabc(gs4) mlabsize(small)
>            legend(off)   graphregion(color(white)) ytitle("Proportional Reduction in Povert
> y Gap (Alternate Threshold)", size(small))
>            xtitle("Proportional Reduction in Poverty Gap", size(small)) ylabel(0(.1).6, nog
> rid labsize(small)) 
>            xlabel(.2(.1).6, nogrid labsize(small))
>            b1title("(Threshold: Poverty Line)", size(small));

.    graph save 20161021_Gap_Red.gph, replace;
(file 20161021_Gap_Red.gph saved)

.    spearman GAP_RED*;
(obs=50)

             | GAP_RE~1 GAP_RE~2 GAP_RE~3 GAP_RE~4
-------------+------------------------------------
   GAP_RED_1 |   1.0000 
   GAP_RED_2 |   0.7969   1.0000 
   GAP_RED_3 |   0.6421   0.9331   1.0000 
   GAP_RED_4 |   0.5835   0.8979   0.9721   1.0000 

.                 twoway scatter PROP_RED_1 PROP_RED_2, mlab(state) m(i) mlabc(gs12) mlabsize
> (small)
>         || scatter PROP_RED_3 PROP_RED_2,  mlab(state) m(i) mlabc(gs8) mlabsize(small)
>         || scatter PROP_RED_4 PROP_RED_2,  mlab(state) m(i) mlabc(gs4) mlabsize(small)
>         legend(off)   graphregion(color(white)) ytitle("Proportional Reduction in Poverty R
> ate (Alternate Threshold)", size(small))
>         xtitle("Proportional Reduction in Poverty Rate", size(small)) ylabel(0(.1).6, nogri
> d labsize(small)) 
>         xlabel(.1(.1).5, nogrid labsize(small))
>         text(.6 .1 "Alternate Thresholds, as % of Poverty Line", placement(east) size(vsmal
> l))
>         text(.58 .12 "50%", color(gs12) placement(east) size(small)) 
>         text(.58 .21 "150%", color(gs8) placement(east) size(small)) 
>         text(.58 .31 "200%", color(gs4) placement(east) size(small))
>         b1title("(Threshold: Poverty Line)", size(small));

.    graph save 20161021_Prop_Red.gph, replace;
(file 20161021_Prop_Red.gph saved)

.    spearman PROP*;
(obs=50)

             | PROP_R~1 PROP_R~2 PROP_R~3 PROP_R~4
-------------+------------------------------------
  PROP_RED_1 |   1.0000 
  PROP_RED_2 |   0.5281   1.0000 
  PROP_RED_3 |   0.4320   0.7658   1.0000 
  PROP_RED_4 |   0.3840   0.5614   0.7281   1.0000 

.   twoway scatter R_1 R_2, mlab(state) m(i) mlabc(gs12) mlabsize(small)
>   || scatter R_3 R_2,  mlab(state) m(i) mlabc(gs8) mlabsize(small)
>   || scatter R_4 R_2,  mlab(state) m(i) mlabc(gs4) mlabsize(small)
>   legend(off)   graphregion(color(white)) ytitle("Poverty Relief Ratio (Alternate Threshold
> )", size(small))
>   xtitle("Poverty Relief Ratio", size(small)) ylabel(0(.2)1.3, nogrid labsize(small)) 
>   xlabel(.3(.1).7, nogrid labsize(small))
>   b1title("(Threshold: Poverty Line)", size(small))
>    ;

.    graph save 20161021_R_Rank_Order.gph, replace;
(file 20161021_R_Rank_Order.gph saved)

.    spearman R_*;
(obs=50)

             |      R_1      R_2      R_3      R_4
-------------+------------------------------------
         R_1 |   1.0000 
         R_2 |   0.9937   1.0000 
         R_3 |   0.9821   0.9947   1.0000 
         R_4 |   0.9647   0.9836   0.9941   1.0000 

. graph combine 20161021_Prop_Red.gph 20161021_Gap_Red.gph 20161021_R_Rank_Order.gph, col(3);

. graph export "20161021_Varying_Thresholds_Comparison.pdf", replace fontface(Helvetica);
(file /Users/kljusko/Dropbox/Papers/Measurement/Data Analysis/20170308_forJuskoWeisshaarRepli
> cation/20161021_Varying_Thresholds_Comparison.pdf written in PDF format)

. replace MAX=MAX/1000;
(50 real changes made)

. forvalues i=1/4 {;
  2. replace R_`i'=R_`i'*100;
  3. regress R_`i' MAX_TANF;
  4. xtile category_R_`i'=R_`i', nq(4);
  5.  replace PROP_RED_`i'=PROP_RED_`i'*100;
  6. regress PROP_RED_`i'  MAX_TANF;
  7.   xtile category_PROP_`i'=PROP_RED_`i', nq(4);
  8. replace GAP_RED_`i'=GAP_RED_`i'*100;
  9. regress GAP_RED_`i'  MAX_TANF;
 10.   xtile category_GAP_`i'=GAP_RED_`i', nq(4);
 11. };
(50 real changes made)

      Source |       SS       df       MS              Number of obs =      50
-------------+------------------------------           F(  1,    48) =    3.99
       Model |  598.678915     1  598.678915           Prob > F      =  0.0515
    Residual |  7206.12634    48  150.127632           R-squared     =  0.0767
-------------+------------------------------           Adj R-squared =  0.0575
       Total |  7804.80525    49   159.28174           Root MSE      =  12.253

------------------------------------------------------------------------------
         R_1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    MAX_TANF |   21.32857   10.68058     2.00   0.052    -.1461871    42.80332
       _cons |    73.2727   4.936905    14.84   0.000     63.34638    83.19901
------------------------------------------------------------------------------
(50 real changes made)

      Source |       SS       df       MS              Number of obs =      50
-------------+------------------------------           F(  1,    48) =    2.57
       Model |   57.081016     1   57.081016           Prob > F      =  0.1155
    Residual |  1066.48833    48   22.218507           R-squared     =  0.0508
-------------+------------------------------           Adj R-squared =  0.0310
       Total |  1123.56935    49  22.9299867           Root MSE      =  4.7137

------------------------------------------------------------------------------
  PROP_RED_1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    MAX_TANF |   6.585831   4.108868     1.60   0.116    -1.675601    14.84726
       _cons |   34.54872   1.899249    18.19   0.000     30.73003    38.36742
------------------------------------------------------------------------------
(50 real changes made)

      Source |       SS       df       MS              Number of obs =      50
-------------+------------------------------           F(  1,    48) =    0.14
       Model |   4.1836465     1   4.1836465           Prob > F      =  0.7124
    Residual |     1460.34    48  30.4237499           R-squared     =  0.0029
-------------+------------------------------           Adj R-squared = -0.0179
       Total |  1464.52364    49  29.8882376           Root MSE      =  5.5158

------------------------------------------------------------------------------
   GAP_RED_1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    MAX_TANF |   1.782962   4.808073     0.37   0.712    -7.884317    11.45024
       _cons |   48.26233   2.222444    21.72   0.000     43.79381    52.73085
------------------------------------------------------------------------------
(50 real changes made)

      Source |       SS       df       MS              Number of obs =      50
-------------+------------------------------           F(  1,    48) =    4.98
       Model |  179.758819     1  179.758819           Prob > F      =  0.0303
    Residual |   1731.4798    48  36.0724959           R-squared     =  0.0941
-------------+------------------------------           Adj R-squared =  0.0752
       Total |  1911.23862    49  39.0048698           Root MSE      =   6.006

------------------------------------------------------------------------------
         R_2 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    MAX_TANF |   11.68718   5.235435     2.23   0.030     1.160634    22.21373
       _cons |   37.34948   2.419984    15.43   0.000     32.48377    42.21518
------------------------------------------------------------------------------
(50 real changes made)

      Source |       SS       df       MS              Number of obs =      50
-------------+------------------------------           F(  1,    48) =    1.10
       Model |  17.2376465     1  17.2376465           Prob > F      =  0.2985
    Residual |  748.903894    48  15.6021645           R-squared     =  0.0225
-------------+------------------------------           Adj R-squared =  0.0021
       Total |   766.14154    49  15.6355416           Root MSE      =    3.95

------------------------------------------------------------------------------
  PROP_RED_2 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    MAX_TANF |   3.619126   3.443159     1.05   0.298     -3.30381    10.54206
       _cons |   21.33805   1.591538    13.41   0.000     18.13805    24.53805
------------------------------------------------------------------------------
(50 real changes made)

      Source |       SS       df       MS              Number of obs =      50
-------------+------------------------------           F(  1,    48) =    2.51
       Model |  40.4229456     1  40.4229456           Prob > F      =  0.1198
    Residual |  773.335759    48  16.1111617           R-squared     =  0.0497
-------------+------------------------------           Adj R-squared =  0.0299
       Total |  813.758705    49  16.6073205           Root MSE      =  4.0139

------------------------------------------------------------------------------
   GAP_RED_2 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    MAX_TANF |   5.542155   3.498873     1.58   0.120      -1.4928    12.57711
       _cons |   31.60383    1.61729    19.54   0.000     28.35205    34.85561
------------------------------------------------------------------------------
(50 real changes made)

      Source |       SS       df       MS              Number of obs =      50
-------------+------------------------------           F(  1,    48) =    6.26
       Model |  94.2444648     1  94.2444648           Prob > F      =  0.0158
    Residual |   723.13658    48  15.0653454           R-squared     =  0.1153
-------------+------------------------------           Adj R-squared =  0.0969
       Total |  817.381045    49  16.6812458           Root MSE      =  3.8814

------------------------------------------------------------------------------
         R_3 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    MAX_TANF |   8.462382   3.383407     2.50   0.016     1.659586    15.26518
       _cons |   23.41822   1.563918    14.97   0.000     20.27376    26.56269
------------------------------------------------------------------------------
(50 real changes made)

      Source |       SS       df       MS              Number of obs =      50
-------------+------------------------------           F(  1,    48) =    6.32
       Model |  42.4805189     1  42.4805189           Prob > F      =  0.0153
    Residual |  322.506395    48  6.71888324           R-squared     =  0.1164
-------------+------------------------------           Adj R-squared =  0.0980
       Total |  364.986914    49  7.44871254           Root MSE      =  2.5921

------------------------------------------------------------------------------
  PROP_RED_3 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    MAX_TANF |   5.681455   2.259505     2.51   0.015     1.138417    10.22449
       _cons |   12.75073   1.044415    12.21   0.000     10.65079    14.85066
------------------------------------------------------------------------------
(50 real changes made)

      Source |       SS       df       MS              Number of obs =      50
-------------+------------------------------           F(  1,    48) =    4.20
       Model |  42.2406936     1  42.2406936           Prob > F      =  0.0458
    Residual |  482.265903    48  10.0472063           R-squared     =  0.0805
-------------+------------------------------           Adj R-squared =  0.0614
       Total |  524.506596    49  10.7042162           Root MSE      =  3.1697

------------------------------------------------------------------------------
   GAP_RED_3 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    MAX_TANF |   5.665395   2.763041     2.05   0.046     .1099287    11.22086
       _cons |   23.14363   1.277165    18.12   0.000     20.57571    25.71154
------------------------------------------------------------------------------
(50 real changes made)

      Source |       SS       df       MS              Number of obs =      50
-------------+------------------------------           F(  1,    48) =    7.38
       Model |   53.255379     1   53.255379           Prob > F      =  0.0091
    Residual |  346.271902    48  7.21399796           R-squared     =  0.1333
-------------+------------------------------           Adj R-squared =  0.1152
       Total |  399.527281    49  8.15361798           Root MSE      =  2.6859

------------------------------------------------------------------------------
         R_4 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    MAX_TANF |   6.361308   2.341277     2.72   0.009     1.653856    11.06876
       _cons |   16.27991   1.082212    15.04   0.000     14.10397    18.45584
------------------------------------------------------------------------------
(50 real changes made)

      Source |       SS       df       MS              Number of obs =      50
-------------+------------------------------           F(  1,    48) =   15.79
       Model |  49.5033639     1  49.5033639           Prob > F      =  0.0002
    Residual |  150.494112    48    3.135294           R-squared     =  0.2475
-------------+------------------------------           Adj R-squared =  0.2318
       Total |  199.997476    49  4.08158114           Root MSE      =  1.7707

------------------------------------------------------------------------------
  PROP_RED_4 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    MAX_TANF |   6.133128    1.54349     3.97   0.000     3.029734    9.236523
       _cons |   5.466628   .7134501     7.66   0.000     4.032141    6.901116
------------------------------------------------------------------------------
(50 real changes made)

      Source |       SS       df       MS              Number of obs =      50
-------------+------------------------------           F(  1,    48) =    7.00
       Model |  42.7309515     1  42.7309515           Prob > F      =  0.0110
    Residual |  293.072379    48  6.10567456           R-squared     =  0.1272
-------------+------------------------------           Adj R-squared =  0.1091
       Total |   335.80333    49  6.85312919           Root MSE      =   2.471

------------------------------------------------------------------------------
   GAP_RED_4 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    MAX_TANF |   5.698178    2.15393     2.65   0.011     1.367412    10.02894
       _cons |   16.55161   .9956147    16.62   0.000      14.5498    18.55343
------------------------------------------------------------------------------

. 
end of do-file

. *>> APPENDIX B: General Relationship;
. do 20170511_State_thumbnails.do;

. #delimit;
delimiter now ;
. set more off;

. program drop _all;

. use 20161021_Working_hh_1014.dta, clear;

. drop if FIPS==11;
(0 observations deleted)

.  by FIPS,sort: egen group=rank(Y), unique;

. by FIPS, sort: egen count=count(Y);

. replace count=count/100;
(238273 real changes made)

. replace group=round(group/count);
(238273 real changes made)

. collapse totalTransfer Y count (p25) p25TT=total (p75)p75TT=total, by(State group);

.  encode State, gen(state);

. save 20161021_StateThumbnails.dta, replace;
file 20161021_StateThumbnails.dta saved

.         use 20161021_State_Parameters_w_Var.dta, clear;

. matrix drop _all;

. sort State;

. encode State, gen(state);

.  forval j=1/50 {;
  2. mkmat A B1 B2 if state==`j', matrix(state_PAR_`j');
  3. };

. use 20161021_StateThumbnails.dta, clear;

. label define state_lbl 1 "Alabama" 2 "Alaska" 3 "Arizona" 4 "Arkansas" 5 "California" 6 "Co
> lorado" 7 "Connecticut" 8 "Delaware" 9
> "Florida" 10 "Georgia" 11 "Hawaii" 12 "Idaho" 13 "Illinois" 14 "Indiana" 15 "Iowa" 16 "Kans
> as" 17 "Kentucky" 18 "Louisiana" 19
> "Maine" 20 "Maryland" 21 "Massachusetts" 22 "Michigan" 23 "Minnesota" 24 "Mississippi" 25 "
> Missouri" 26 "Montana" 27 "Nebraska" 28
> "Nevada" 29 "New Hampshire" 30 "New Jersey" 31 "New Mexico" 32 "New York" 33 "North Carolin
> a" 34 "North Dakota" 35 "Ohio" 36
> "Oklahoma" 37 "Oregon" 38 "Pennsylvania" 39 "Rhode Island" 40 "South Carolina" 41 "South Da
> kota" 42 "Tennessee" 43 "Texas" 44
> "Utah" 45 "Vermont" 46 "Virginia" 47 "Washington" 48 "West Virginia" 49 "Wisconsin" 50 "Wyo
> ming";

.                         label val state state_lbl;

. graph drop _all;

. local i=1;

. local state_label: value label state;

. while `i' <= 50 {;
  2.     local label: label `state_label' `i';
  3.         twoway scatter total Y if state==`i' & Y<=50, m(Oh) msize(small) 
>                 || rspike p75TT p25TT Y if state==`i' & Y<=50
>                 || function 19.790-x, lcolor(gs2) lpattern(dash) range(0 19.790)
>                 || function y= el(state_PAR_`i',1,1) + el(state_PAR_`i',1,2)*exp(el(state_P
> AR_`i',1,3)*x), range(0 50)
>                         lwidth(thin) 
>             ylabel(0(5)18, labsize(small) tlc(gs14) glc(gs14))
>                 xlabel(0(10)50, labsize(small) tlc(gs14) ) 
>             xscale(lc(gs14)) yscale(lc(gs14)) 
>                 legend(off) graphregion(color(white))   
>             graphregion(margin(t=2 b=1 l=1 r=2))
>             lc(gs10)
>                 text(18 40 "`label'", justification(right) size(medsmall));
  4.                 graph save "State_`i'", replace;
  5.                 local i = `i'+1;
  6.                                 };
(file State_1.gph saved)
(file State_2.gph saved)
(file State_3.gph saved)
(file State_4.gph saved)
(file State_5.gph saved)
(file State_6.gph saved)
(file State_7.gph saved)
(file State_8.gph saved)
(file State_9.gph saved)
(file State_10.gph saved)
(file State_11.gph saved)
(file State_12.gph saved)
(file State_13.gph saved)
(file State_14.gph saved)
(file State_15.gph saved)
(file State_16.gph saved)
(file State_17.gph saved)
(file State_18.gph saved)
(file State_19.gph saved)
(file State_20.gph saved)
(file State_21.gph saved)
(file State_22.gph saved)
(file State_23.gph saved)
(file State_24.gph saved)
(file State_25.gph saved)
(file State_26.gph saved)
(file State_27.gph saved)
(file State_28.gph saved)
(file State_29.gph saved)
(file State_30.gph saved)
(file State_31.gph saved)
(file State_32.gph saved)
(file State_33.gph saved)
(file State_34.gph saved)
(file State_35.gph saved)
(file State_36.gph saved)
(file State_37.gph saved)
(file State_38.gph saved)
(file State_39.gph saved)
(file State_40.gph saved)
(file State_41.gph saved)
(file State_42.gph saved)
(file State_43.gph saved)
(file State_44.gph saved)
(file State_45.gph saved)
(file State_46.gph saved)
(file State_47.gph saved)
(file State_48.gph saved)
(file State_49.gph saved)
(file State_50.gph saved)

. graph combine State_1.gph State_3.gph State_4.gph State_5.gph State_6.gph State_7.gph 
>   State_8.gph State_10.gph State_11.gph  State_13.gph State_14.gph State_15.gph 
>   State_16.gph State_17.gph State_18.gph  State_19.gph State_20.gph State_21.gph, col(3)
>   b1title("Market Income ($1000s)", size(medsmall)) l1title("Social Transfers ($1000s)", si
> ze(medium)) scheme(s1mono);

.                         graph display, ysize(8) xsize(6);

. graph export 20161021_Appendix_1.pdf, replace fontface(Helvetica);
(file /Users/kljusko/Dropbox/Papers/Measurement/Data Analysis/20170308_forJuskoWeisshaarRepli
> cation/20161021_Appendix_1.pdf written in PDF format)

. graph combine     State_22.gph
>    State_23.gph State_24.gph State_25.gph State_26.gph State_27.gph State_28.gph State_29.g
> ph State_30.gph 
>    State_31.gph State_32.gph State_33.gph State_34.gph State_35.gph State_36.gph State_37.g
> ph  
>   State_38.gph State_39.gph, col(3)
>   b1title("Market Income ($1000s)", size(medsmall)) l1title("Social Transfers ($1000s)", si
> ze(medium)) scheme(s1mono);

.                         graph display, ysize(8) xsize(6);

. graph export 20161021_Appendix_2.pdf, replace fontface(Helvetica);
(file /Users/kljusko/Dropbox/Papers/Measurement/Data Analysis/20170308_forJuskoWeisshaarRepli
> cation/20161021_Appendix_2.pdf written in PDF format)

. graph combine   State_40.gph State_41.gph State_42.gph State_43.gph State_44.gph 
>   State_45.gph State_46.gph State_47.gph State_48.gph State_49.gph State_50.gph, col(3)
>   b1title("Market Income ($1000s)", size(medsmall)) l1title("Social Transfers ($1000s)", si
> ze(medium)) scheme(s1mono);

.                         graph display, ysize(8) xsize(6);

. graph export 20161021_Appendix_3.pdf, replace fontface(Helvetica);
(file /Users/kljusko/Dropbox/Papers/Measurement/Data Analysis/20170308_forJuskoWeisshaarRepli
> cation/20161021_Appendix_3.pdf written in PDF format)

. 
end of do-file

. *>> APPENDIX C: State Level Analysis;
. do 20170511_stateParameterTable.do;

. #delimit;
delimiter now ;
. use 20161021_Working_hh_1014.dta, clear;

. collapse (count) n=Y, by(FIPS);

. merge 1:1 FIPS using 20161021_State_Parameters_w_Var.dta;

    Result                           # of obs.
    -----------------------------------------
    not matched                             0
    matched                                50  (_merge==3)
    -----------------------------------------

. gen SE_A=sqrt(V_A);

. gen SE_B1=sqrt(V_B1);

. gen SE_B2=sqrt(V_B2);

. keep State n A SE_A B1 SE_B1 B2 SE_B2 TAU_2 SD_TAU R_2 SD_R_2;

. order State n A SE_A B1 SE_B1 B2 SE_B2 TAU_2 SD_TAU R_2 SD_R_2;

. export excel using "20161021_stateParameterTable.xlsx", first(variables) replace;
file 20161021_stateParameterTable.xlsx saved

. 
end of do-file

. *>> APPENDIX D: SIPP Replication;
. *do "/Users/kljusko/Dropbox/Papers/Measurement/Data Analysis/SIPP/20161013_SIPP_run.do";
. *>> APPENDIX E:  Household Adjustment;
. set output error;
